package J1_13;

import java.util.Scanner;

public class J113task2 {
    public static void main(String[] args) {
        int n;
        String a;
        Scanner scanner =new Scanner(System.in);
        System.out.printf("输入矩形长度:");
        n=scanner.nextInt();
        System.out.printf("输入打印图形的字符");
        a=scanner.next();
        for (int i=0;i<n;i++){
            if (i==0||i==n-1){
                for (int j=0;j<n;j++){
                    System.out.printf(a);
                }

            }
            else {
                for (int j=n-1;j>=0;j--){
                    if (j==0||j==n-1){
                        System.out.printf(a);
                    }
                    else {
                        for (int k=0;k<a.length();k++)
                            System.out.printf(" ");
                    }
                }
            }
            System.out.println();
        }
    }
}
